<include file='Admin/Tpl/Public/nav.html' />
<link rel="stylesheet" href="__PUBLIC__/Css/pagestyle.css"> 
    <div class="sidebar-right-heading">
        <ul class="nav nav-tabs square nav-justified">
          <li class="active"><a href="#online-user-sidebar" data-toggle="tab"><i class="fa fa-comments"></i></a></li>
          <li><a href="#notification-sidebar" data-toggle="tab"><i class="fa fa-bell"></i></a></li>
          <li><a href="#task-sidebar" data-toggle="tab"><i class="fa fa-tasks"></i></a></li>
          <li><a href="#setting-sidebar" data-toggle="tab"><i class="fa fa-cogs"></i></a></li>
        </ul>
    </div>
    <div class="page-content">
        <div class="container-fluid">
            <br/>
            <div class="col-sm-3 left">
                <div class="the-box">
                    <h4>推送添加</h4>
                    <form id="ExampleBootstrapValidationForm" method="post" enctype="multipart/form-data" action="__URL__/add_act">
                        <div class="form-group">
                                <label>推送名称<span style="color:red"> * </span></label>
                                <div>
                                    <input type="text" class="form-control must" id="name" type="text" name="notice_title" />
                                </div>
                        </div>
                        <div class="form-group">
                                <label>推送描述<span style="color:red"> * </span></label>
                                <div>
                                    <textarea class="form-control input-lg no-resize must" name="notice_detail" style="height:240px;"></textarea>
                                </div>
                        </div>
                        <div class="form-group">
                            <input class="btn btn-primary" id="submit"  type="submit" value="添加" />
                        </div>                                    
                    </form>
                </div>
            </div>
            
            <div class="col-sm-9 right">
                <div class="the-box">
                    <div class="table-responsive div1 div_search">
                        <table class="table table-th-block table-hover">
                            <thead>
                                <tr style="text-align:center">
                                    <td style="width:3%"><input type="checkbox" disabled /></td>
                                    <td style="text-align:center;width:50px">编号</td>
                                    <td style="text-align:center;width:180px">标题</td>
                                    <td style="text-align:center;width:220px">细节</td>
                                    <td style="text-align:center;width:60px">操作</td>
                                </tr>
                            </thead>
                            <form action="__URL__/deleteall" method="post">
                                <tbody>
                                    <volist name="rs.data" id="val"> 
                                        <tr> 
                                            <td style="width:3%">                                           
                                                <input type="checkbox" class="checkboxes" value="{$val.notice_id}" name="id[]"/>
                                            </td>                    
                                            <td style='text-align:center;vertical-align:middle'>{$val.notice_id}</td>
                                            <td style='text-align:center;vertical-align:middle'>{$val.notice_title}</td>
                                            <td style='text-align:center;vertical-align:middle'>{$val.notice_detail}</td>
                                            <td style='text-align:center;vertical-align:middle'>
                                                <span class="delete"><a href='javascript:void(0)' onclick='to_del({$val.notice_id})' title='Delete'>删除</a></span>
                                            </td>
                                        </tr>
                                    </volist>
                                    <tr>
                                        <td style="text-align:center；border-right:0px;" colspan="3">
                                            <button type="button" class="button">全选</button>
                                            <button type="button" class="button">反选</button>
                                            <input type="submit" class="button" value="删除" onclick="return confirm(' 你确定要删除吗？')">
                                        </td>
                                    </tr>
                                </tbody>
                            </form>
                        </table>
                        <ul class="pagination success">{$rs.show}</ul>
                    </div>
                    <div class="table-responsive" id="hl"></div>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
<script src="__PUBLIC__/assets/js/jquery.min.js"></script>
<script src="__PUBLIC__/Js/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript">
$(".current").css({background:"#8CC152",color:"white"});
function to_del(a){
    if(confirm("确认删除?")){
        $.get('__URL__/del?notice_id='+a,'',function(){window.location='__SELF__';},'json');  
    }
}

var len = $('.must').length;
$("#submit").click(function(){
    for(var i=0;i<len;i++){
        if($(".must:eq("+i+")").val()==""){
            $(".must:eq("+i+")").css({border:"2px solid red"});
            return false;
        }
    }
});

$(".must").focus(function(){
    $(this).css({border:"2px solid #89F2D8"});
});
$(".must").blur(function(){
    $(this).css({border:""});
});

$(function () {         
    var bool = true;
    $(':button:contains(全选)').bind('click',function(){
        // 全选一定有标示状态
        $(':checkbox[name="id[]"]').each(function(){
            $(this).prop('checked',bool);
        });
        bool=!bool;
    });

     $(':button:contains(反选)').bind('click',function(){     
        $(':checkbox[name="id[]"]').each(function(){
            $(this).prop('checked',!this.checked);
        });
     });
 })
</script>

</html>
